<?php

// CWebApplication properties can be configured here.
return CMap::mergeArray(
	require_once dirname(__FILE__).'/main.php',
	require_once dirname(dirname(__FILE__)).'/modules/poll/config.php', 
 	array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Webvietpro',
	'preload'=>array('log'),
	'theme'	=>	'site',
	// autoloading model and component classes
	'import'=>array(
 		'application.components.*',
		'application.models.site.*',
		'application.helpers.*',
		'ext.giix-components.*', // giix components
		'ext.STranslateableBehavior.*',
	),
	'behaviors' => array('SiteConfigBehavior'),
	'modules'=>array(
		// uncomment the following to enable the Gii tool
			'site_shop',
			'poll'
	),

	// application components
	'components'=>array(
		'config' => array(
         	'class' => 'application.components.XConfigComponent',
      	),
		'cache'=>array(
				'class'=>'system.caching.CFileCache',
				'cacheFileSuffix'=>'.bin'
		),
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		// uncomment the following to enable URLs in path-format
		'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(
				'<lang>'	=>	'site/index',
				'<lang>/<action:(login|logout|about)>' => 'site/<action>',
				'<lang>/<alias>'=>'site/page',
				'<lang>/<cat_alias>/<alias>'=>'post/read',
				
				'<lang>/<controller:\w+>/<action:\w+>' => '<controller>/<action>',
			),
			//'urlSuffix'		=>	'/',
            'showScriptName'=>false,
		),
		
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site_frontend/index/error',
        ),
		/*'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				
			),
		),*/
	),

)
);
